home *** CD-ROM | disk | FTP | other *** search
- Path: colossus.holonet.net!windmill!charlie.brown
- Distribution: world
- Newsgroups: comp.lang.c
- X-Apparently-to: FRED@SPIDER.COMPART.FI
- From: charlie.brown@windmill.com (Charlie Brown)
- References: <4ebc03$4gv@gate.compart.fi>
- Date: Mon, 29 Jan 1996 14:17:00 -0600
- Organization: The Windmill Company BBS - 806-792-6116
- Subject: The size of a file
- Message-ID: <59.28250.5782@windmill.com>
-
- F>This is driving me nuts. I can't find a simple way to get the size of a
- >disk file. This must be possible using the standard C library, but I
- >haven't figured out how!
-
- This works with MSC, Borland may have a different name
- for _dos_findfirst().
-
- #include <dos.h>
- long fsize(filespec)
- char *filespec;
- {
- struct find_t fileinfo;
-
- if(0 == _dos_findfirst(filespec,0,&fileinfo))
- return fileinfo.size;
- else
- return 0L;
- }
- ---
- * QMPro 1.01 41-4987 * BorgBurger: We do it our way. Your way is irrelevant.
-